package JavaSe;

import java.util.Map;
import java.util.TreeMap;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}17:02
 */
public class TreeMapDemo {
    public static void main(String[] args) {
        String s = "asdfasdf2eqrwefsdafs";
        getResut(s);
    }

    public static void getResut(String s){
        char[] arr = s.toCharArray();
        Map<Character,Integer> map = new TreeMap<>();

        for (char c : arr) {
            if (map.containsKey(c)){
                map.put(c,map.get(c)+1);
            }else {
                map.put(c,0);
            }
        }

        for (Character character : map.keySet()) {
            System.out.println(character);
        }
    }
}
